﻿namespace ServiceCore.Utility
{
    public class StaticVar
    {
        /// <summary>
        /// 得到当前http请求的目录
        /// </summary>
        public static string HttpPath
        {
            get
            {
                var path = AppContext.BaseDirectory;
                if (path.EndsWith("/"))
                    return path.TrimEnd('/');
                else if (path.EndsWith(@"\"))
                    return path.TrimEnd('\\');
                else
                    return path;
            }
        }

        public static string PathSplitLine
        {
            get
            {
                var path = AppContext.BaseDirectory;
                if (path.EndsWith("/"))
                    return "/";
                else
                    return @"\";
            }
        }

        public static bool IsCentos
        {
            get
            {
                var path = AppContext.BaseDirectory;
                if (path.EndsWith("/"))
                    return true;
                else
                    return false;
            }
        }
    }
}
